package com.hao.jdbctemplate;

import com.hao.jdbctemplate.pojo.User;
import com.hao.jdbctemplate.service.UserService;
import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * TODO
 *
 * @author 97472
 * @version 1.0
 * @date 2021/11/5 16:50
 */
public class test {

    @Test
    public void test1(){
        ApplicationContext context = new ClassPathXmlApplicationContext("spring.xml");
        UserService userServiceImpl = context.getBean("userServiceImpl", UserService.class);
        User user = new User();
        user.setName("小明");
        user.setAddr("中国");
        user.setUsername("123123");
        user.setPassword("321321");
        userServiceImpl.add(user);
    }

}
